/**
 * 
 */
package de.guidoludwig.jtm.domain;

import javax.persistence.MappedSuperclass;

import org.hibernate.search.annotations.Analyze;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Store;

/**
 * @author guido
 *
 */
@MappedSuperclass
public abstract class NamedPersistentObject extends AbstractPersistentObject {
	
	public static final String PROPERTY_NAME = "name";
	
	@Field(index=Index.YES, analyze=Analyze.YES, store=Store.NO)
	private String name;
	
	protected NamedPersistentObject() {
		super();
	}
	
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		String old = getName();
		this.name = name;
		firePropertyChange(PROPERTY_NAME, old, getName());
	}	

}
